package cn.iocoder.yudao.module.design.enums.design;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;

/**
 * @author Annie
 * @ClassName ProblemRelStatus
 * @description: TODO
 * @date 2023年11月16日
 * @version: 1.0
 */
@Getter
@AllArgsConstructor
public enum ProblemRelStatusCdEnum {
    /**
     * 问题处理状态枚举
     */
    PROBLEM_REL_STATUS_CD_ENUM_0("0","待确认"),
    PROBLEM_REL_STATUS_CD_ENUM_1("1","处理中"),
    PROBLEM_REL_STATUS_CD_ENUM_2("2","解决待验证"),
    PROBLEM_REL_STATUS_CD_ENUM_3("3","未通过"),
    PROBLEM_REL_STATUS_CD_ENUM_4("4","已关闭"),
    PROBLEM_REL_STATUS_CD_ENUM_5("5","与我无关");

    private String code;

    private String name;

    public static String getNameByCode(String code) {
        for (ProblemRelStatusCdEnum sourceType : ProblemRelStatusCdEnum.values()) {
            if (sourceType.getCode().equals(code)) {
                return sourceType.getName();
            }
        }
        return null; // 如果没有找到对应的name，可以根据实际需求返回一个默认值或抛出异常
    }

    public static final String[] GET_CODES = Arrays.stream(values()).map(ProblemRelStatusCdEnum::getCode).toArray(String[]::new);

    public static final String[] GET_NAMES = Arrays.stream(values()).map(ProblemRelStatusCdEnum::getName).toArray(String[]::new);

}
